<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace oss_cs;

/**
 * Description of OssFactory
 *
 * @author DevPHP
 * @version 2018-4-13
 */
class OSSCSClient {

    /**
     * 
     * @param type $bucket
     * @param type $object
     * @param type $file
     * @return type
 * @version 2018-4-13
     */
    public static function upload($bucket, $object, $file) {
        //$api = new oss\AliOssApi();
        $api = new oss\QcCosApi();
        return $api->uploadFile($bucket, $object, $file);
    }

    public static function listBuckets() {
        $api = new oss\AliOssApi();
        return $api->listBuckets();
    }

    public static function createBucket($bucket) {
        $api = new oss\AliOssApi();
        return $api->createBucket($bucket, \OSS\OssClient::OSS_ACL_TYPE_PUBLIC_READ);
    }

}
